# print("Hello world", "Razey") # 输出两个字符串

import sys
import objects

import time

# print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) # 函数的本来面目

# print("Hello world", "Razey", sep="-") # sep参数用于设置多个字符串之间的间隔
#
# print("Hello world", "Razey", end=" ") # end参数用于设置结尾字符，默认是换行符
# print("Hello world", "Razey", end=" ") # end参数用于设置结尾字符，默认是换行符,现改为空字符，即什么都没有

# with open("test.txt", "w", encoding='utf-8') as f: # 打开文件
#     print("你好", "Razey", file=f) # file参数用于设置输出位置，默认是标准输出
#
# import  time
# with open("output.txt", "w", encoding='utf-8') as f: # 打开文件
#      for i in range(10):
#          print(i, file=f, flush=False) # flush参数用于设置是否立即输出，默认是False，即不立即输出,True是实时输出，会更消耗性能
#          time.sleep(1) # 暂停1秒


with open("test.txt", "w", encoding='utf-8') as f:  # 打开文件
    print("你好", "Razey", file=f)  # file参数用于设置输出位置，默认是标准输出

import time

with open("output.txt", "w", encoding='utf-8') as f:  # 打开文件
    for i in range(10):
        print(i, file=f, flush=True)  # flush参数用于设置是否立即输出，默认是False，即不立即输出,True是实时输出，会更消耗性能
        time.sleep(1)  # 暂停1秒
